<?php

namespace Celebrio\Caching;

use Nette\Object;
use Nette\Environment;
use Nette\Caching\FileStorage;

/**
 * @author pavel
 */
class CacheFactory extends Object
{

    /**
     *
     * @return \Nette\Caching\ICacheStorage
     */
    public static function storage() {
        if(WinCacheStorage::isAvailable()){
            return new WinCacheStorage();
        } elseif(APCStorage::isAvailable()) {
            return new APCStorage();
        } else {
            return new FileStorage(Environment::getVariable("tempDir"));
        }
    }

}
